-
Notifications
You must be signed in to change notification settings - Fork 672
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable screenshot functionality (closes #104) #130
Enable screenshot functionality (closes #104) #130
Conversation
What about steps with empty test names? For all of them will be saved pageLoad.png |
@@ -41,6 +41,7 @@ | |||
testCafeCore.SETTINGS.set({ | |||
CURRENT_TEST_STEP_NAME: nextStep ? stepNames[nextStep - 1] : 'Test initialization', | |||
BROWSER_STATUS_URL: '{{{browserStatusUrl}}}', | |||
ENABLE_SCREENSHOTS: {{{enableScreenshots}}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like enableScreenshots
, maybe takeScreenshots
? \cc @VasilyStrelyaev
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep
BTW, I don't see code which attaches screenshot path on errors. And we need to add both types of screenshots in |
\r- |
If we implement this behavior we need not any sprecific code which attaches screenshot path on errors. We set the |
@AlexanderMoskovkin We've discussed what if there were an error, then screenshot should be attached to the error text: #104 (comment) So the report should look like this:
Sorry, seems like I was not quite clear in our discussion. |
ok |
I suppose, we should save the image as |
@AlexanderMoskovkin AFAIK you can't create step without a name in current API. Unnamed steps are subject of the new API and we will have a lot of other things to redo because of this. So, I think we shouldn't bother right now. |
I've checked it works with empty step names now. For example if an assertion failed in this step we see in the report |
/cc @inikulin @VasilyStrelyaev |
yellow is not too much of warning |
ca708d3
to
9d3f6eb
Compare
FPR |
`${this.screenshotPath}\\${isFailedStep ? 'errors\\' : ''}${stepName.replace(/\s/g, '_') || | ||
'Page_Load'}.png`; | ||
|
||
//NOTE: we should not fail the test if we can't make a screenshot for some reason |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test should not fail if we can't make a screenshot for some reason
/r- |
9d3f6eb
to
c804a48
Compare
lgtm |
FPR |
@@ -13,26 +16,23 @@ export var batchUpdate = transport.batchUpdate.bind(transpor | |||
export var queuedAsyncServiceMsg = transport.queuedAsyncServiceMsg.bind(transport); | |||
|
|||
export function fail (err, callback) { | |||
// NOTE: we should not stop the test run if an error occured during page unloading because | |||
// we destroy the session in this case and we can't get the next page in the browser. | |||
// We should set the deferred error to the task to fail the test after the page reloading. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// NOTE: we should not stop the test run if an error occured during page unloading because
// we would destroy the session in this case and wouldn't be able to get the next page in the browser.
// We should set the deferred error to the task to have the test failed after the page reloading.
/r- |
790d080
to
b0108e1
Compare
export function fatalError (err, callback) { | ||
// NOTE: we should not stop the test run if an error occured during page unloading because we | ||
// would destroy the session in this case and wouldn't be able to get the next page in the browser. | ||
// We should set the deferred error to the task to have the test failed after the page reloading. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sht... sorry, my mistake - have the test fail
// We should set the deferred error to the task to have the test fail after the page reloading.
/r- |
b0108e1
to
bee81e7
Compare
lgtm |
FPR |
lgtm |
ping @helen-dikareva |
this.savedDocumentTitle = document.title; | ||
document.title = assignedTitle; | ||
} | ||
}, 50); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move it to const
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch
\r- |
bee81e7
to
1768a35
Compare
FPR |
lgtm |
1 similar comment
lgtm |
…nctionality Enable screenshot functionality (closes #104)
thanks |
We have client tests for this and server tests for reporting with screenshots now. Also I've created the functional tests locally, but we will commit them when we implement the #52 issue, because we need something like
functional-tests-harness
/cc @inikulin @helen-dikareva